using System.Xml;
using System.Xml.Schema;

namespace Vibstudio.X4NET.Xml.Generation
{
    #region Namespaces

    

    #endregion

    internal abstract class InstanceObject
    {
        #region Fields

        private string _defaultValue;
        private bool _firstGen = true;
        private string _fixedValue;

        #endregion

        #region Properties

        internal string DefaultValue
        {
            get { return _defaultValue; }
            set { _defaultValue = value; }
        }

        internal string FixedValue
        {
            get { return _fixedValue; }
            set { _fixedValue = value; }
        }

        internal XmlSchemaForm Form { get; set; }

        internal bool HasDefault
        {
            get
            {
                if (_defaultValue != null && _firstGen)
                {
                    _firstGen = false;
                    return true;
                }
                return false;
            }
        }

        internal bool IsFixed
        {
            get
            {
                return _fixedValue != null;
            }
        }

        internal XmlQualifiedName QualifiedName { get; set; }

        internal XmlValueGenerator ValueGenerator { get; set; }

        #endregion
    }
}